/***************************************************************************
 *   Copyleft 2008-2009 by												   *
 *	 Iwanicki Krzysztof													   *
 *   <gamma.mini.pw.edu.pl/~iwanickik>									   *
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 *   This program is distributed in the hope that it will be useful,       *
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
 *   GNU General Public License for more details.                          *
 ***************************************************************************/
#ifndef __VRESOURCESMANAGER_H__
#define __VRESOURCESMANAGER_H__

#include "../Graphics/vTexture2D.h"
#include "../Patterns/vSingleton.h"
#include "../../Utils/vUtils.h"
#include "./vResourcesLoader.h"
#include "../../Macros/vMemoryMacros.h"


namespace Vendetta {
	class vResourcesManager {
		friend class vEngine3D;

	public:

		vTexture2D* Texture2D(const vString& texName);

		vBool LoadResources(vResourcesLoader& loader);

	private:
		vResourcesManager();
		~vResourcesManager();
		vResourcesManager(const vResourcesManager& factory);
		vResourcesManager& operator=(const vResourcesManager& factory);

		vVoid createResources(vResourcesLoader& loader);

		vVoid createTextures(vResourcesLoader& loader);
		vVoid deleteTextures();

	private:
		vHashMap<vString, vTexture2D*> mTextures2D;
	};
}

#endif // __VRESOURCESMANAGER_H__